#! /bin/sh

name=dbus
version=1.16.2
revision=1
git_url="https://gitlab.freedesktop.org/dbus/dbus.git"
commit=958bf9db2100553bcd2fe2a854e1ebb42e886054
imagedeps="git meson ninja-build"
hostdeps="gcc pkg-config"
deps="core-libs libexpat"

configure() {
    meson_configure \
        -Druntime_dir=/run \
        -Ddoxygen_docs=disabled \
        -Dxml_docs=disabled \
        -Dsystemd_system_unitdir=no \
        -Dsystemd_user_unitdir=no \
        -Dsystem_pid_file=/run/dbus/pid \
        -Dsystem_socket=/run/dbus/system_bus_socket \
        -Dselinux=disabled \
        -Dapparmor=disabled \
        -Dlibaudit=disabled \
        -Dkqueue=disabled \
        -Dlaunchd=disabled \
        -Dsystemd=disabled \
        -Dmodular_tests=disabled
}

build() {
    ninja -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" ninja install

    touch "${dest_dir}/${prefix}"/share/dbus-1/session.d/.keep
    touch "${dest_dir}"/var/lib/dbus/.keep

    post_package_strip
}
